/**
 * @Author: lll
 * @Email:li.lele@vpclub.cn
 * @Date: create in 2020/7/8
 */
package cn.vpclub.admin.mapper;

import cn.vpclub.admin.entity.CollectionsEntity;
import cn.vpclub.admin.param.CollectionsResponseParam;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Mapper
public interface CollectionsMapper extends BaseMapper<CollectionsEntity> {
    /**
     * 我的收藏
     *
     * @param id
     * @return
     */
    @Select("select collections.id AS id,article.article_title AS articleTitle,article.tab_content as tabContent ,collections.articleId as articleId from article,collections where collections.userId = #{id} and collections.articleId = article.id")
    public List<CollectionsResponseParam> selectMyCollections(String id);
}
